<div class="division">
<h3><span class="label-warning">1</span>请选择需要退换货的商品及数量</h3>
<form method="POST" id='newmember-edit-form' action="index.php?app=b2c&ctl=admin_order&act=save_apply" class="tableform">

    <div  class="table-grid">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="gridlist">
        	<col style="width:15%"/>
        	<col style="width:15%"/>
        	<col style="width:15%"/>
        	<col style="width:40%"/>
        	<col style="width:20%"/>
                <thead>
                    <th><{t}>申请<{/t}></th>
                    <th><{t}>数量<{/t}></th>
                    <th><{t}>货号<{/t}></th>
                    <th><{t}>商品名称<{/t}></th>
                    <th><{t}>单价<{/t}></th>
                </thead>
                <{if count($goodsItems) > 0}>
              <{foreach from=$goodsItems item=aGoods name="item"}>
        		<{if $aGoods.product}>
                <tr>
                    <input type="hidden" name="order_id" value="<{$aGoods.product.order_id}>">
                    <input type="hidden" name="member_id" value="<{$member_id}>">
                    <td class="actions">
                        <input type="checkbox" name="product_bn[<{$aGoods.product.products.product_id}>]" value="<{$aGoods.product.bn}>" id="" class="x-check" vtype="requiredcustom" data-validatormsg="请先选择要退换的商品">
                        <label for="">退换</label>
                    </td>
                    <td class="Colamount">
                        <input class="x-input" type="text" name="product_nums[<{$aGoods.product.products.product_id}>]" required="1" value="<{$aGoods.product.quantity}>" id="">
                        <!--增加隐藏的input框记录商品的购买数量，2015-10-12，by liu-->
                        <input class="x-input" type="hidden" name="product_num[<{$aGoods.product.products.product_id}>]" required="1" value="<{$aGoods.product.quantity}>" id="">
                    </td>
                    <td width="19%"><{$aGoods.product.bn}>
                        <input type="hidden" name="product_name[<{$aGoods.product.products.product_id}>]"  value="<{$aGoods.product.name}>" >
                    </td>

                  <td class="textleft" width="30%"><{if $aGoods.product.link}><a href="<{$aGoods.product.link}>" target="_blank"><{/if}><{$aGoods.product.name}><{if $aGoods.product.link}></a><{/if}><{if $aGoods.product.is_type == 'goods' && $aGoods.product.small_pic}> <a style='text-decoration:none;' class='x-view-img' href='javascript:void(0);' imgsrc='<{$aGoods.product.small_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>'  title='<{$aGoods.product.name}>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> <{/if}> </td>
                  <input type="hidden" name="product_price[<{$aGoods.product.products.product_id}>]" value="<{$aGoods.product.price|cur_odr:$order.currency}>">
                  <input type="hidden" name="product_price[<{$aGoods.product.products.product_id}>]" value="<{$aGoods.product.price}>">
                  <td width="12%"><{$aGoods.product.price|cur_odr:$order.currency}></td>
                </tr>
        	  <{/if}>
              <{if $aGoods.adjunct}>
              <tr>
                <td colspan="6" style="padding:0 0 0 20px;  background:#F7FAFB; font-weight:bold; text-align:left"><{t}>商品配件<{/t}></td>
              </tr>
              <{foreach from=$aGoods.adjunct item=ajuncts name="ajunctsItem"}>
              <tr>
                <td width="19%" style="border:none;"><{$ajuncts.bn}></td>
                <td class="textleft" width="30%" style="border:none;"><{if $ajuncts.link}><a href="<{$ajuncts.link}>" target="_blank"><{/if}><{$ajuncts.name}>
                  <{if $ajuncts.minfo && is_array($ajuncts.minfo)}>
                  <{foreach from=$ajuncts.minfo item=minfo key=name}> <br>
                  <{$minfo.label}>：<{$minfo.value}>
                  <{/foreach}>
                  <{/if}><{if $ajuncts.link}></a><{/if}><{if $ajuncts.is_type == 'goods' && $ajuncts.small_pic}> <a style='text-decoration:none;' class='x-view-img' href='javascript:void(0);' imgsrc='<{$ajuncts.small_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>'  title='<{$ajuncts.name}>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> <{/if}> </td>
                <td class="Colamount"><{$ajuncts.sendnum}></td>
                <td width="12%"><{$ajuncts.price|cur_odr:$order.currency}></td>
                <td class="Colamount" width="15%" ><{$ajuncts.total_amount|cur_odr:$order.currency}></td>
                <td class="Colamount"><{$ajuncts.quantity}></td>
              </tr>
              <{/foreach}>
              <{/if}>
              <{if $aGoods.gifts}>
              <tr>
                <td colspan="6" style="padding:0 0 0 0; background:#F4F4F4;text-align:left"><{t}>商品赠品<{/t}></td>
              </tr>
              <{foreach from=$aGoods.gifts item=gifts name="giftsItem"}>
              <tr>
                <td width="19%" ><{$gifts.bn}></td>
                <td class="textleft" width="30%"><{if $gifts.link}><a href="<{$gifts.link}>" target="_blank"><{/if}><{$gifts.name}>
                  <{if $gifts.minfo && is_array($gifts.minfo)}>
                  <{foreach from=$gifts.minfo item=minfo key=name}> <br>
                  <{$minfo.label}>：<{$minfo.value}>
                  <{/foreach}>

                  <{/if}><{if $gifts.link}></a><{/if}><{if $gifts.small_pic}> <a style='text-decoration:none;' class='x-view-img' href='javascript:void(0);' imgsrc='<{$gifts.small_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>'  title='<{$gifts.name}>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> <{/if}> </td>

                <td class="Colamount"><{$gifts.sendnum}></td>
                <td width="12%"><{$gifts.price|cur_odr:$order.currency}></td>
                <td class="Colamount" width="15%"><{$gifts.total_amount|cur_odr:$order.currency}></td>
                <td class="Colamount"><{$gifts.quantity}></td></tr>
              <{/foreach}>
              <{/if}>
              <{/foreach}>
        	  <{/if}>

              <{if $giftItems}>
              <tr>
                <td colspan="6" style="border:none;padding:0" ><div style=" border-bottom:1px solid #ddd;font-weight:bold;background:#F4F4F4;  padding-left:50px; text-align:left"><{t}>优惠赠品<{/t}></div></td>
              </tr>
              <{foreach from=$giftItems item=aGoods name="item"}>
              <tr>
                <td width="19%"><{$aGoods.bn}></td>

                <td class="textleft"><{if $aGoods.link}><a href="<{$aGoods.link}>" target="_blank"><{/if}><{$aGoods.name}><{if $aGoods.link}></a><{/if}> <{if $aGoods.small_pic}> <a style='text-decoration:none;' class='x-view-img' href='javascript:void(0);' imgsrc='<{$aGoods.small_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>'  title='<{$aGoods.name}>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a> <{/if}> </td>


                <td class="Colamount"><{$aGoods.sendnum}></td>
                <td width="12%"><{$aGoods.price|cur_odr:$order.currency}></td>
                <td class="Colamount" width="15%"><{$aGoods.total_amount|cur_odr:$order.currency}></td>
                <td class="Colamount"><{$aGoods.quantity}></td>
              </tr>
              <{/foreach}>
        	  <{/if}>

        	  <!-- 扩展的商品区域 -->
        	  <{if $extends_items}>
        	  <{foreach from=$extends_items item=aExtends name="item"}>
                <{$aExtends}>
        	  <{/foreach}>
        	  <{/if}>
        	  <!-- end -->
        </table>
    </div>
    <h3><span>2</span>填写退换理由</h3>
    <ul class="member-content">
        <li>
            <label><em class="red">*</em>类型：</label>
            <span>
              <input type="radio" name="type" value="1" id="return" vtype="required" data-caution="请填写退换理由" checked="checked"><label for="return">退货</label>
              <input type="radio" name="type" value="2" id="exchange" vtype="required" data-caution="请填写换货理由"><label for="exchange">换货</label>
            </span>
        </li>
        <li>
            <label><em class="red">*</em>退换理由：</label>
            <span>
              <input type="text" name="title"  class="x-input" placeholder="简单描述退换理由" vtype="required" data-caution="请填写退换理由">
            </span>
        </li>
        <li>
            <label>详细描述：</label>
            <span>
              <textarea name="content"  class="x-input" cols="50" rows="5" placeholder="请描述遇到的问题以及详细的退换理由，不超过1000字"></textarea>
            </span>
        </li>
        <div class="table-action">
            <button type="submit" class="btn btn-caution"><span><span>提交申请</span></span></button>
        </div>
    </ul>
</div>

<script>
    $$('.x-view-img').each(function(item){
		item.store('tip:text','<div style="width:220px;height:220px;overflow:hidden;"><img  src="'+item.get('imgsrc')+'" onload="$(this).zoomImg(220,220);" /></div>');
	   Xtip.attach(item);
    });
    Object.merge(validatorMap, {
});
</script>